package com.amumu.drama.admin.modules.order.service;

import com.amumu.drama.admin.dto.OmsMoneyInfoParam;
import com.amumu.drama.admin.dto.OmsReceiverInfoParam;
import com.amumu.drama.common.base.api.CommonPage;
import com.amumu.drama.common.base.dto.req.IdReq;
import com.amumu.drama.common.modules.admin.dto.OmsOrderDeliveryParam;
import com.amumu.drama.common.modules.admin.dto.OmsOrderQueryParam;
import com.amumu.drama.common.modules.order.dto.req.*;
import com.amumu.drama.common.modules.order.dto.resp.OmsOrderDetailResp;
import com.amumu.drama.common.modules.order.dto.resp.OmsOrderQueryResp;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 订单管理Service
 * Created by macro on 2018/10/11.
 */
public interface OmsOrderService {
    /**
     * 分页查询订单
     */
    List<OmsOrderQueryResp> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum);

    /**
     * 批量发货
     */
    @Transactional
    int delivery(List<OmsOrderDeliveryParam> deliveryParamList);

    /**
     * 批量关闭订单
     */
    @Transactional
    int close(List<Long> ids, String note);

    /**
     * 批量删除订单
     */
    int delete(List<Long> ids);

    /**
     * 获取指定订单详情
     */
    OmsOrderDetailResp detail(Long orderId);

    /**
     * 修改订单收货人信息
     */
    @Transactional
    int updateReceiverInfo(OmsReceiverInfoParam receiverInfoParam);

    /**
     * 修改订单费用信息
     */
    @Transactional
    int updateMoneyInfo(OmsMoneyInfoParam moneyInfoParam);

    /**
     * 修改订单备注
     */
    @Transactional
    int updateNote(Long id, String note, Integer status);

    OmsOrderDetailResp getOrderDetail(Long orderId);

    /** 去充值 */
    void manualDelivery(AdminManualDeliveryReq request);

    /** 重试接口充值 */
    @Transactional(rollbackFor = Exception.class)
    void retryInterfaceDelivery(AdminRetryInterfaceRechargeReq request);

    /** 充值成功 */
    void manualDeliverySuccess(AdminDeliverySuccessReq request);

    /** 退款 */
    void refund(AdminRefundReq request);

    /** 强制接口充值更改为手工充值 */
    void forceInterfaceToManuel(IdReq request);

    void interfaceReturn(AdminReturnReq request);

    CommonPage<OmsOrderQueryResp> listOrder(OmsOrderQueryParam request);
}
